import { createRouter, createWebHashHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue';
import GangWei from '../views/GangWei.vue';
import BuMen from '../views/BuMen.vue';
import YuanGong from '../views/YuanGong.vue';
import HomeIndex from '../views/HomeIndex.vue';
import RenCai from '../views/RenCai.vue';
import XiangMu from '../views/XiangMu.vue';
import DiaoGang from '../views/DiaoGang.vue';
const routes = [
  // {
  //   path: '/',
  //   name: 'home',
  //   // component: HomeView
  //   redirect: '/management/Home',
  // },
  {
    path: '/',
    name: 'register',
    redirect: '/register',
  },
  {
    path: '/',
    name: 'home',
    // component: HomeView
    redirect: '/about',
  },
  {
    path: '/management/',
    name: 'management',
    component: HomeView,
    meta: {
      title: '首页'
    },
    children: [
      {
        path: 'Home',
        name: 'Home',
        component: HomeIndex, meta: {
          // title:'首页'
        },
      },
      {
        path: 'gangwei',
        name: 'gangwei',
        component: GangWei,
        meta: {
          title: '岗位'
        }
      },
      {
        path: 'bumen',
        name: 'bumen',
        component: BuMen,
        meta: {
          title: '部门'
        }
      },

      {
        path: 'yuangong',
        name: 'yuangong',
        component: YuanGong,
        meta: {
          title: '员工'
        }
      }, 
      {
        path: 'rencai',
        name: 'rencai',
        component: RenCai,
        meta: {
          title: '人才'
        }
      }, 
      {
        path: 'xiangmu',
        name: 'xiangmu',
        component: XiangMu,
        meta: {
          title: '项目'
        }
      }, 
      {
        path: 'diaogang',
        name: 'diaogang',
        component: DiaoGang,
        meta: {
          title: '调岗'
        }
      }
    ]
  },
  {
    path: '/register',
    name: 'register',
    component: ()=>import('../views/ZhuCe.vue')
  },

  {
    path: '/about',
    name: 'about',
    component: () => import('../views/AboutView.vue')
  },
  {
    path: '/hello',
    name: 'HelloWorld',
    component: () => import('../components/HelloWorld.vue')
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
